﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using BLL;
using Model;

namespace 联盟酒店
{
    public partial class 添加用户 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnadd_Click(object sender, EventArgs e)
        {
            Personalmodel p = new Personalmodel();
            p.nameper = txtname.Text.Trim();
            p.nid = txtnid.Text.Trim();
            p.Sex = txtsex.Text.Trim();
            p.tel = txttel.Text.Trim();
            p.pwd = txtpwd.Text.Trim();
            p.mid =Convert.ToInt32( txtmid.Text.Trim());
            int r = UserInfoBLL.adduserinfo(p);
            if (r > 0)
            {
                Response.Write("<script>alert('添加成功')</script>");
                Response.Redirect("用户管理.aspx");

            }
            else
            {
                Response.Write("<script>alert('添加失败')</script>");
            }
        }
    }
}